﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using Thaire.Investment.Domains.Transaction;

namespace Thaire.Investment.Repository
{
    public class FixincomesecuritiesAmortizeHeaderRepo : BaseRepository<FixincomesecuritiesAmortizeHeader, int>
    {
       public FixincomesecuritiesAmortizeHeaderRepo(ISession session)
            : base(session)
        {
        }

       public FixincomesecuritiesAmortizeHeader GetByFixIncomeHeaderIDAndPurchaseID(int headerID, int purchaseID)
       {
           return _session.QueryOver<FixincomesecuritiesAmortizeHeader>()
                          .Where(x => x.FixincomesecuritiesHeaderID == headerID).And(x=>x.FixincomesecuritiesPurchaseID == purchaseID).SingleOrDefault();
       }
    }
}
